fix(spp_api_v2): skip records without identifiers instead of crashing#162
fix(spp_api_v2): skip records without identifiers instead of crashing#162
Conversation
|
You have used all of your free Bugbot PR reviews. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
There was a problem hiding this comment.
Code Review
This pull request updates the to_api_schema and membership_to_response methods to return None and log a warning instead of raising a ValidationError when external identifiers are missing. Corresponding null checks have been added to the search routers and the get_groups service. Review feedback highlights the need for more robust identifier selection to prevent malformed API references and warns of potential crashes in single-resource endpoints that have not yet been updated to handle the new None return value.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 19.0 #162 +/- ##
==========================================
+ Coverage 71.19% 71.50% +0.30%
==========================================
Files 931 933 +2
Lines 54694 55467 +773
==========================================
+ Hits 38942 39664 +722
- Misses 15752 15803 +51
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
OpenSPP API breaks upon serializing data that has missing identity documents. This is due to the web UI having it optional while the API schema requires it. I propose to align the schema with the the web UI and have it be optional as well.